181a85
@@ -646,6 +646,7 @@
public void close() throws HiveSQLException {
         hiveHist.closeStream();
       }
       try {
+        sessionState.resetThreadName();
         sessionState.close();
       } finally {
         sessionState = null;
@@ -655,6 +656,7 @@
public void close() throws HiveSQLException {
     } finally {
       if (sessionState != null) {
         try {
+          sessionState.resetThreadName();
           sessionState.close();
         } catch (Throwable t) {
           LOG.warn("Error closing session", t);
